import sys
import platform
from PyQt5.QtWidgets import QApplication, QMainWindow
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QCursor
from mainwindow import Ui_MainWindow
# QSS_PATH = "/home/umeko/puregui/QSS/MacOS.qss"
QSS_PATH = "D:\gitee\puregui\QSS\MacOS.qss"

class MainWindow(QMainWindow, Ui_MainWindow):
    def __init__(self):
        super().__init__()
        self.setupUi(self)

        # 根据平台隐藏鼠标
        if platform.system() == "Linux":
            QApplication.setOverrideCursor(QCursor(Qt.BlankCursor))
def load_stylesheet(filename):
    """Load and return the stylesheet from a file."""
    with open(filename, "r") as file:
        return file.read()
    
if __name__ == "__main__":
    
    app = QApplication(sys.argv)
    
    mainWindow = MainWindow()
    mainWindow.setStyleSheet(load_stylesheet(QSS_PATH))
    mainWindow.show()
    sys.exit(app.exec_())
